package com.mes.fixture.controller;

import com.mes.common.pojo.MESResult;
import com.mes.fixture.server.FixtureTypeServer;
import com.mes.pojo.fixture.FixtureType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 张喆
 * @Company
 * @Description
 * @Time 2024/10/22 14:38
 */
@RestController
@CrossOrigin
@RequestMapping("/fixtureType")
public class FixtureTypeController {
    @Autowired
    private FixtureTypeServer fixtureServer;
    @GetMapping("/list")
    public MESResult getList(FixtureType fixtureType, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer limit){
        return fixtureServer.queryAll(fixtureType,pageNum,limit);
    }
    @GetMapping("/updateInfo")
    public MESResult getUpdateTypeInfo(String fixtureTypeId){
        return fixtureServer.queryById(fixtureTypeId);
    }
    @GetMapping("/allColumn")
    public MESResult getAllColumn(){
        return fixtureServer.queryAllColumn();
    }
    @DeleteMapping("/delete")
    public MESResult deleteFixtureType(String fixtureTypeId){
        return fixtureServer.deleteFixtureType(fixtureTypeId);
    }
    @PutMapping("/update")
    public MESResult updateFixtureType(@RequestBody FixtureType fixtureType){
        return fixtureServer.updateFixtureType(fixtureType);
    }
    @PostMapping("/insert")
    public MESResult insertFixtureType(@RequestBody FixtureType fixtureType){
        return fixtureServer.insertFixtureType(fixtureType);
    }
}
